/**
* Copyright (C) 2018-2022
* All rights reserved, Designed By www.yixiang.co
* 注意：
* 本软件为www.yixiang.co开发研制，未经购买不得使用
* 购买后可获得全部源代码（禁止转卖、分享、上传到码云、github等开源平台）
* 一经发现盗用、分享等行为，将追究法律责任，后果自负
*/
package co.yixiang.modules.tanzer.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableName;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.validation.constraints.*;

import javax.persistence.Transient;
import java.util.Date;
import java.math.BigDecimal;
import co.yixiang.domain.BaseDomain;

/**
* @author hupeng
* @date 2024-08-04
*/
@Data
@TableName("ZHIJ_ERP_PRODUCT")
public class Product extends BaseDomain {
    /** 表ID，主键，供其他表做外键 */
    @TableId
    private Long id;

    /** 产品名称 */
    @NotBlank
    private String productName;

    /** 产品编码 */
    @NotBlank
    private String productCode;

    /** 产品图片 */
    private String productPic;

    /** 材料费 */
    @NotNull
    private BigDecimal material;

    /** 打板师 */
    @NotNull
    private Long purchaserId;

    /** 打板费 */
    @NotNull
    private BigDecimal edition;

    /** 手工费 */
    @NotNull
    private BigDecimal handwork;

    /** 成本 */
    @NotNull
    private BigDecimal cost;

    /** 批发价 */
    @NotNull
    private BigDecimal wholesale;

    /** 零售价 */
    @NotNull
    private BigDecimal retail;

    @NotNull
    private Long numScm;

    @NotNull
    private Long numXscm;

    @NotNull
    private Long numMcm;

    @NotNull
    private Long numLcm;

    /** 状态 */
    @NotBlank
    private String enabledFlag;

    /** 备注说明 */
    private String remark;



    private String attribute1;

    private String attribute2;

    private String attribute3;

    private String attribute4;

    private String attribute5;



    @ApiModelProperty(value = "美甲师" )
    @TableField(exist = false)
    @Transient
    private String manicuristName;

    @ApiModelProperty(value = "美甲师编码" )
    @TableField(exist = false)
    @Transient
    private String manicuristCode;

    @ApiModelProperty(value = "总数量" )
    @TableField(exist = false)
    @Transient
    private Long sumNum;

    public void copy(Product source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
